<?php
use Illuminate\Support\Facades\Route;

/*
 * |--------------------------------------------------------------------------
 * | API Routes
 * |--------------------------------------------------------------------------
 * |
 * | Here is where you can register API routes for your application. These
 * | routes are loaded by the RouteServiceProvider within a group which
 * | is assigned the "api" middleware group. Enjoy building your API!
 * |
 */

// 登录
Route::group([
    'prefix' => 'user/auth',
    'namespace' => 'User\Auth'
], function () {
    Route::post('sign-in', 'IndexController@signIn');
    Route::post('sign-out', 'IndexController@signOut');
});

// 老师
Route::group([
    'prefix' => 'teachers',
    'namespace' => 'Teachers',
    'middleware' => 'auth.user:1'
], function () {
    Route::get('getList', 'IndexController@getList');
});
// 家长
Route::group([
    'prefix' => 'parents',
    'namespace' => 'Parents',
    'middleware' => 'auth.user:2'
], function () {
    Route::get('getList', 'IndexController@getList');
});
// 学生
Route::group([
    'prefix' => 'students',
    'namespace' => 'Students',
    'middleware' => 'auth.user:3'
], function () {
    Route::get('getList', 'IndexController@getList');
});

